package iscas.pay.controller;

import iscas.pay.common.CustomResult;
import iscas.pay.dto.PayDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class PayController {

    // 支付
    @PostMapping("/topay")
    private CustomResult topay(@RequestBody PayDTO payDTO) {
        System.out.println("用户ID：" + payDTO.getUserId() + "支付了" + payDTO.getPrice() + "元");
        return new CustomResult(20000, "支付成功", null);
    }
}
